package imp.core.data.songhistory;

import imp.core.basics.date.Date;


/**
 * This class represents a song history entry which is an item in the song history list. In
 * other words, a song history entry is a song object which was played at a special date.
 * @author Patrick Arnold
 * @since 09.09.2010
 *
 */
public class SongHistoryEntry {

	/** The song id of the played song. */
	private long id;
	
	/** The name of the song */
	private String name;
	
	/** The date when the song was played. */
	private Date date;
	
	/** Specifies how long the song was played (in seconds). */
	private int duration;
	
	/** Specifies how long the song was played (in percent). */
	private double percentage;
	
	/** Specifies whether this song still exists or not. */
	private boolean exists;

	
	
	/**
	 * Constructor - Creates a new song history entry.
	 * @param id The id of the song.
	 * @param name The name of the song.
	 * @param date The date of the song. 
	 * @param duration Specifies how long the song was played (in seconds).
	 * @param percentage Specifies how long the song was played (in percent).
	 * @param exists Specifies whether this song still exists.
	 */
	public SongHistoryEntry( long id, String name, Date date, int duration, double percentage, 
			boolean exists) {
		this.id = id;
		this.date = date;
		this.duration = duration;
		this.percentage = percentage;
		this.exists = exists;
	}



	/**
	 * Returns the id of the played song..
	 * @return The id of the played song.
	 */
	public long getId() {
		return id;
	}


	/**
	 * Returns the name of the played song.
	 * @return The name of the played song.
	 */
	public String getName() {
		return name;
	}


	/**
	 * Returns the date of the played song.
	 * @return The date of the played song.
	 */
	public Date getDate() {
		return date;
	}


	/**
	 * Specifies how long the song was being played (in seconds).
	 * @return The duration which specifies, how long the song was being played (in seconds).
	 */
	public int getDuration() {
		return duration;
	}


	/**
	 * Specifies how long the song was being played (in percent).
	 * @return The duration which specifies, how long the song was being played (in seconds).
	 */
	public double getPercentage() {
		return percentage;
	}


	/**
	 * Specifies whether the song still exists or not. Annotation: It can be possible, that the
	 * song was deleted and therefore does not exist anymore.
	 * @return Specifies whether the played song still exists or not.
	 */
	public boolean stillExists() {
		return exists;
	}
	
	
}